package com.example.calendarprovider;


import com.example.calendarprovider.bean.ImageItem;

import java.util.List;
//单例模式

/**
 * 当你最次点击加号跳转到媒体库获取图片回来将图片呈现出来的时候，这个过程可能会出现很多次，所以使用单例模式
 */
public class PickConfig {

    private PickConfig(){

    }
    private static PickConfig mPickConfig;
    public static PickConfig getInstance(){
        if(mPickConfig==null){
            mPickConfig=new PickConfig();
        }
        return mPickConfig;
    }

    public int maxSelectCont=1;
    private OnImageSelectedFinishListener mImageSelectFinshedListener=null;

    public int getMaxSelectCount(){
        return maxSelectCont;
    }

    public void setMaxSelectCont(int maxSelectCount){
        this.maxSelectCont=maxSelectCount;
    }
    public void SetOnItemSelectFinishListener(OnImageSelectedFinishListener listener){
        this.mImageSelectFinshedListener=listener;
    }
    public OnImageSelectedFinishListener getOnItemSelectFinishListener(){
        return mImageSelectFinshedListener;
    }

    public interface OnImageSelectedFinishListener{
           public void onSelectFinished(List<ImageItem> result);
    }
}
